/**
 * @description: 全局请求拦截中间件
 * @author: YoungYa
 * @date: 2024/11/23
 */
import { NextFunction, Request, Response } from 'express';
export function requestMiddleware(req: Request, res: Response, next: NextFunction) {
  const ignoreRouter: string[] = ['/auth/login', '/auth/logout', '/common/'];
  if (req['method'] === 'GET' || ignoreRouter.join().includes(req['url'])) {
    next();
  } else {
    res.send({ code: -1, msg: '演示系统,禁止操作!', data: null });
  }
}
